﻿using System;
using System.Collections.Generic;
using System.Text;

namespace han
{
    public static class NextClass
    {
        public static int[] CalNextDay(int[] input)
        {
            int year = input[0];
            int month = input[1];
            int day = input[2];
            if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
            {
                if (day == 31)
                {
                    if (month == 12)
                    {
                        return new int[] { year + 1, 1, 1 };
                    }
                    else
                    {
                        return new int[] { year, month + 1, 1 };
                    }
                }
                else
                {
                    return new int[] { year, month, day + 1 };
                }

            }
            else if (month == 4 || month == 6 || month == 9 || month == 11)
            {
                if (day == 30)
                {

                    return new int[] { year, month + 1, 1 };

                }
                else
                {
                    return new int[] { year, month, day + 1 };
                }
            }
            else
            {
                if (year % 4 == 0)
                {
                    if (day == 29)
                    {
                        return new int[] { year, month + 1, 1 };
                    }
                    else
                    {
                        return new int[] { year, month, day + 1 };
                    }
                }
                else
                {
                    if (day == 28)
                    {
                        return new int[] { year, month + 1, 1 };
                    }
                    else
                    {
                        return new int[] { year, month, day + 1 };
                    }
                }
            }

            return null;
        }
    }
}
